<template>
  <section>
  	<div class="model retrieval">
      <img :src="IMGBASE64.JIANSUOGUANLI2X" class="orange">
      <span class="title">检索管理</span>
      <div class="body">
        <el-select v-model="selectValue" filterable clearable placeholder="请输入考试姓名" size="small">
          <el-option
            v-for="item in allNameData"
            :label="item.name"
            :value="item.value">
          </el-option>
        </el-select>
        <el-button type="primary" size="small">搜索</el-button>
        <router-link to="/exam/score/newadd">
          <el-button type="success" size="small">新增</el-button>
        </router-link>
      </div>
  	</div>

  	<div class="model score">
  		<img src="../../assets/images/icon/chengjidengfen@2x.png" class="pink">
  		<span class="title">新建考试</span>
      <div class="kong"></div>
			<el-table :data="examData" style="width: 100%">
        <el-table-column prop="num" label="#" align="center" width="80"></el-table-column>
        <el-table-column prop="name" label="考试名称" align="center" width="120" :show-overflow-tooltip='true'></el-table-column>
        <el-table-column prop="time" label="考试时间" align="center"></el-table-column>
        <el-table-column prop="jTime" label="登分截止时间" align="center"></el-table-column>
        <el-table-column prop="subject" label="考试科目" align="center" :show-overflow-tooltip='true'></el-table-column>
        <el-table-column prop="YON" label="是否公开分数" align="center" width="150"></el-table-column>
        <el-table-column prop="grade" label="考试年级" align="center" :show-overflow-tooltip='true'></el-table-column>
      </el-table>
  	</div>
  </section>
</template>

<script>
export default {
  data () {
    return {
      selectValue: null,
      allNameData: [],
      examData: [{
        num: '1',
        name: '期末考试',
        time: '2017/06/27',
        jTime: '2017/06/27',
        subject: '语文、数学、英语',
        YON: '是',
        grade: '一年级，二年级，三年级，四年级，五年级，六年级'
      },
      {
        num: '2',
        name: '期末考试',
        time: '2017/06/27',
        jTime: '2017/06/27',
        subject: '语文、数学、英语',
        YON: '是',
        grade: '一年级，二年级，三年级，四年级，五年级，六年级'
      },
      {
        num: '3',
        name: '期末考试',
        time: '2017/06/27',
        jTime: '2017/06/27',
        subject: '语文、数学、英语',
        YON: '是',
        grade: '一年级，二年级，三年级，四年级，五年级，六年级'
      }]
    }
  },
  mounted () {
    // let _cookie = document.cookie.split(';')
    // let _cookieArray = []
    // _cookie.forEach(v => {
    //   let _d = v.split('=')
    //   _cookieArray.push({
    //     key: _d[0],
    //     value: _d[1]
    //   })
    // })
    this.$http.post(this._httpUrl + 'exam/score/queryExamination', {}, {'headers': {'yxt-xtoken': localStorage.xtoken}}).then(function (response) {
      if (response.body.code === '000') {
        // console.log(response.data.data)
        this.examData = response.data.data
      } else if (response.body.code === '887') {
        this.$router.push('/')
      } else if (response.body.code === '889') {
        this.$router.push('/')
      }
    })
  }
}
</script>

<style lang="less" scoped>
@import '/static/css/all-use.css';
.retrieval{
	.body{
		span{
    	margin-left: 4%;
    }
    span:first-child{
    	margin-left: 0;
    }
    .select{
      width: 10%;
      border: 0;
      border-bottom: 1px solid #D7D7D7;
    }
	}
	.bottom{
		.select{
			width: 10%;
      border: 0;
      border-bottom: 1px solid #D7D7D7;
      margin-right: 4%;
		}
	}
}
.clear{
	clear: both;
}
.score{
  .body{
    padding: 40px 20px 10px 120px;
  }
	min-height: 200px;
  li{
    width: 25%;
    float: left;
    padding: 15px 0px 15px 0;
    text-align: right;
    input{
      width: 40%;
      margin-left: 10%;
    }
  }
  .bottom{
    padding: 20px 20px 10px 120px;
    text-align: center;
  }
}
</style>
